package model.symbol;

import event.SymbolChangeEvent;

/**
 * This interface is for objects wanting to observe changes to {@link Symbol}s in the {@link Scope}.
 * 
 * Authors: Neil Dickson
 */
public interface ScopeObserver {
	/**
	 * Indicates that a {@link Symbol} was added to the {@link Scope}
	 * @param scope		the {@link Scope} to which the {@link Symbol} was added
	 * @param symbol	the {@link Symbol} that was added to the {@link Scope}
	 */
	void symbolAdded(Scope scope,Symbol symbol);

	/**
	 * Indicates that a {@link Symbol} was removed from the {@link Scope}
	 * @param scope		the {@link Scope} from which the {@link Symbol} was removed
	 * @param symbol	the {@link Symbol} that was removed from the Scope
	 */
	void symbolRemoved(Scope scope,Symbol symbol);

	/**
	 * Indicates that a {@link Symbol} was changed in some way (e.g. renamed, type change)
	 * NOTE: This will not be called for description changes, because nothing would observe them.
	 * @param scope		the {@link Scope} that contains the {@link Symbol}
	 * @param e			the {@link SymbolChangeEvent} that occurred
	 */
	void symbolChanged(Scope scope,SymbolChangeEvent e);
}
